import math

A=float(input())

def fun(x):
    return math.exp(2*x)-1-2*x-2*x**2

def fun_diff(x):
    return math.exp(2*x)*2-2-4*x

def fun_diff_diff(x):
    return math.exp(2*x)*4-4

def fi(x):
    return x-(fun(x)*fun_diff(x))/(fun_diff(x)**2-fun(x)*fun_diff_diff(x))

def newton(x,max_times,error):
    cnt=0
    while 1==1:
        cnt+=1
        new_x = fi(x)
        print("%.5f %d" % (new_x, cnt))
        if math.fabs(new_x-x)<error or cnt==max_times:
            break
        x=new_x
    return new_x

newton(A,500,0.0001)


